<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 原理 不是每个子节点单独设置事件监听器,而是事件监听器设置在其父节点上,
        然后利用冒泡原理影响设置每个子节点-->
        <ul>
            <li>徐丢丢徐丢丢</li>
            <li>徐丢丢徐丢丢</li>
            <li>徐丢丢徐丢丢</li>
            <li>徐丢丢徐丢丢</li>
            <li>徐丢丢徐丢丢</li>
        </ul>
        <script>
            var ul = document.querySelector('ul')
            ul.addEventListener('click',function(e){
                alert('变变变')
                e.target.style.backgroundColor = 'pink'
            })
        </script>
</body>
</html>